//
//  DetailView.m
//  CWRD
//
//  Created by lanou on 15/9/17.
//  Copyright (c) 2015年 lanou. All rights reserved.
//

#import "DetailView.h"

@implementation DetailView

- (instancetype)initWithFrame:(CGRect)frame {
    self = [super initWithFrame:frame];
    if (self) {
        
     //   self.backgroundColor = [UIColor whiteColor];
        
        //创建模糊视图
        
        _blurImageView = [[BlurImageView alloc]initWithFrame:CGRectMake(0, 0, kWidth, kHeight)];
        _blurImageView.image = [UIImage imageNamed:@"image001.jpg"];
        [self addSubview:_blurImageView];
        
        //视频封面图
        _videoImageView = [[UIImageView alloc]initWithFrame:CGRectMake(0, 0, kWidth, 3 * kHeight / 5 - 64)];
        _videoImageView.backgroundColor = [UIColor grayColor];
        [_blurImageView addSubview:_videoImageView];
        
        //播放按钮
        _playButton = [UIButton buttonWithType:(UIButtonTypeCustom)];
        _playButton.frame = CGRectMake((kWidth - 50) / 2, (3 * kHeight / 5 - 100) / 2, 50, 50);
        _playButton.backgroundColor = [UIColor blackColor];
    //    [_playButton setBackgroundImage:[UIImage imageNamed:@"player_play@2x"] forState:(UIControlStateNormal)];
    //    [_playButton setBackgroundImage:[UIImage imageNamed:@"player_play_hl@2x"] forState:(UIControlStateSelected)];
        [_blurImageView addSubview:_playButton];
        
        //标题名
        _titleLabel = [[UILabel alloc]initWithFrame:CGRectMake(10, 3 * kHeight / 5 - 54, 350, 30)];
        _titleLabel.textColor = [UIColor whiteColor];
        _titleLabel.font = [UIFont fontWithName:@"FZLTZCHJW--GB1-0" size:17.0];
        [_blurImageView addSubview:_titleLabel];
        
        //分割横线
        _lineView = [[UIView alloc]initWithFrame:CGRectMake(10, 3 * kHeight / 5 + 35 - 60, 80, 1)];
        _lineView.backgroundColor = [UIColor whiteColor];
        [_blurImageView addSubview:_lineView];
        
        //类型和时间
        _typeAndTimeLabel = [[UILabel alloc]initWithFrame:CGRectMake(10, 3 * kHeight / 5  + 40 +1 - 64, 350, 30)];
        _typeAndTimeLabel.textColor = [UIColor whiteColor];
        _typeAndTimeLabel.font = [UIFont fontWithName:@"Lobster 1.4" size:15.0];
        [_blurImageView addSubview:_typeAndTimeLabel];
        
        //介绍
        _introductionLabel = [[UILabel alloc]initWithFrame:CGRectMake(10, 3 * kHeight / 5  + 45 +1 + 30 - 64, kWidth - 20, 60)];
        _introductionLabel.textColor = [UIColor whiteColor];
        _introductionLabel.backgroundColor = [UIColor greenColor];
        _introductionLabel.font = [UIFont systemFontOfSize:15.0];
        [_blurImageView addSubview:_introductionLabel];
        
        //收藏按钮
        _likeButton = [UIButton buttonWithType:(UIButtonTypeCustom)];

        _likeButton.frame = CGRectMake(5, 3 * kHeight / 5  + 50 +1 + 30 + 60 - 64 + 30, 40, 40);
        //_likeButton.backgroundColor = [UIColor redColor];
        [_likeButton setImage:[UIImage imageNamed:@"13"] forState:UIControlStateNormal];
        [_blurImageView addSubview:_likeButton];
        
        //收藏数
        _likeCountLabel = [[UILabel alloc]initWithFrame:CGRectMake(40, _likeButton.frame.origin.y, 60, 30)];
        _likeCountLabel.font = [UIFont systemFontOfSize:15.0];
        _likeCountLabel.textColor = [UIColor whiteColor];
        [_blurImageView addSubview:_likeCountLabel];
        
        //分享按钮
        _shareButton = [UIButton buttonWithType:(UIButtonTypeCustom)];
        _shareButton.frame = CGRectMake(120, _likeButton.frame.origin.y, 30, 30);
        [_shareButton setBackgroundImage:[UIImage imageNamed:@"mini_share@3x"] forState:(UIControlStateNormal)];
        _shareButton.backgroundColor = [UIColor orangeColor];
        [_blurImageView addSubview:_shareButton];
        
        //分享数
        _shareCountLabel = [[UILabel alloc]initWithFrame:CGRectMake(150, _likeButton.frame.origin.y, 60, 30)];
        _shareCountLabel.textColor = [UIColor whiteColor];
        _shareCountLabel.font = [UIFont systemFontOfSize:15.0];
        [_blurImageView addSubview:_shareCountLabel];
        
        //下载按钮
        _downloadButton = [UIButton buttonWithType:(UIButtonTypeCustom)];
        _downloadButton.frame = CGRectMake(230, _likeButton.frame.origin.y, 30, 30);
        _downloadButton.backgroundColor = [UIColor whiteColor];
        [_downloadButton setBackgroundImage:[UIImage imageNamed:@"mini_cached@3x"] forState:(UIControlStateNormal)];
        [_downloadButton setBackgroundImage:[UIImage imageNamed:@"btn_download_disabled@2x"] forState:(UIControlStateSelected)];
        [_blurImageView addSubview:_downloadButton];
        
        //下载数
        _downloadLabel = [[UILabel alloc]initWithFrame:CGRectMake(260, _likeButton.frame.origin.y, 60, 30)];
        _downloadLabel.backgroundColor = [UIColor blackColor];
        [_blurImageView addSubview:_downloadLabel];
        
        
    }
    return self;
}


@end
